package com.stx.test.serialize.evilPackage;

import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;

/**
 * packageName com.stx.test.serialize.evilPackage
 *
 * @author YangYi
 * @className execDemo
 * @date 2025/10/7
 * @description TODO
 */
public class execDemo {
    public static void main(String[] args) {
        System.out.println("制作恶意包裹");
        EvilPack evilPack = new EvilPack();
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            ObjectOutputStream oos = new ObjectOutputStream(bos);
            // 将恶意数据写进去
            oos.writeObject(evilPack);
        }catch (Exception e){
            e.printStackTrace();
        }
        byte[] maliciousData = bos.toByteArray();
        System.out.println("恶意包裹制作完成，发送");
        execSerialize.receivePack(maliciousData);
    }
}
